﻿
using System;
using System.Data;
using System.Data.SqlClient;
namespace Model
{
	
	/// <summary>	 
	/// 图片库
	/// </summary>
	public class DbPicture
	{ 
		#region DbPicture
		/// <summary>
		/// 
		/// </summary>
		public DbPicture()
		{
		}
		/// <summary>	 
		/// 
		/// </summary>
		public DbPicture(Int32 pId)
		{
			this.pId = pId;
		
		}
		/// <summary>	 
		/// 
		/// </summary>		
		public DbPicture(DataRow dr)
		{
			int.TryParse(Convert.ToString(dr["pId"]),out pId);
			this.pTitle = Convert.ToString(dr["pTitle"]);
			this.pDefaultImg = Convert.ToString(dr["pDefaultImg"]);
			this.pNotes = Convert.ToString(dr["pNotes"]);
			this.pStatus = Convert.ToInt16(dr["pStatus"]);
			if(dr["pAddTime"] != DBNull.Value)
				this.pAddTime = Convert.ToDateTime(dr["pAddTime"]);
			int.TryParse(Convert.ToString(dr["pOrder"]),out pOrder);
			int.TryParse(Convert.ToString(dr["pViews"]),out pViews);
			
		}
		#endregion
		
		
		#region PId
		private Int32 pId;
		/// <summary>	 
		/// 
		/// AutoInc
		/// PK
		/// </summary>
		public Int32 PId
		{
			get{ return pId; }
			set{ pId= value; }
		}
		#endregion
		
		#region PTitle
		private System.String pTitle;
		/// <summary>	 
		/// 图片名称
		/// </summary>
		public System.String PTitle
		{
			get{ return pTitle; }
			set{ pTitle= value; }
		}
		#endregion
		
		#region PDefaultImg
		private System.String pDefaultImg;
		/// <summary>	 
		/// 默认显示图片
		/// </summary>
		public System.String PDefaultImg
		{
			get{ return pDefaultImg; }
			set{ pDefaultImg= value; }
		}
		#endregion
		
		#region PNotes
		private System.String pNotes;
		/// <summary>	 
		/// 内容
		/// </summary>
		public System.String PNotes
		{
			get{ return pNotes; }
			set{ pNotes= value; }
		}
		#endregion
		
		#region PStatus
		private Int16 pStatus;
		/// <summary>	 
		/// 状态
		/// </summary>
		public Int16 PStatus
		{
			get{ return pStatus; }
			set{ pStatus= value; }
		}
		#endregion
		
		#region PAddTime
		private DateTime pAddTime;
		/// <summary>	 
		/// 加入时间
		/// </summary>
		public DateTime PAddTime
		{
			get{ return pAddTime; }
			set{ pAddTime= value; }
		}
		#endregion
		
		#region POrder
		private Int32 pOrder;
		/// <summary>	 
		/// 排序
		/// </summary>
		public Int32 POrder
		{
			get{ return pOrder; }
			set{ pOrder= value; }
		}
		#endregion
		
		#region PViews
		private Int32 pViews;
		/// <summary>	 
		/// 访问数
		/// </summary>
		public Int32 PViews
		{
			get{ return pViews; }
			set{ pViews= value; }
		}
		#endregion

	}
}
